﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VideoReflector.Controllers
{
    /// <summary>
    /// Abstract base class implementing INotifyPropertyChanged interface to allow automatic updates on property binding
    /// </summary>
    public abstract class NotifyingObject : INotifyPropertyChanged
    {
        /// <summary>
        /// Event invoked when the underlying valu of property of a derived class is changed
        /// </summary>
        public event PropertyChangedEventHandler PropertyChanged;

        /// <summary>
        /// Fire PropertyChanged event
        /// </summary>
        /// <param name="propertyName"> Name of property which was changed </param>
        protected void NotifyPropertyChanged(String propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
